3.1. Heralded high-fidelity parity-check gate for two photons in polarization DOFThe quantum circuit of the HH-PCG for polarization DOF of a two-photon system is shown in Fig. 2(a). The subscripts 1 and 2 stand for the first photon and the second photon. The state of the NV center in the HH-PCG is initialized to
(
). Two photons 1 and 2 in the state (αi|Ri⟩ + βi|Li⟩) (i = 1, 2) are imported into the quantum circuit (shown in Fig. 2(a)) in sequence. The initial state of the system comprised of two photons and the NV center is
First, photon 1 is imported into the quantum circuit using the optical switch SW1. After photon 1 passes through the circularly polarization beam splitter (CPBS1), which transmits the right circularly polarized component (|R⟩) and reflects the left circularly polarized component (|L⟩), the two circularly polarized components of photon 1 are split into two spatial modes. The state of the system comprised of two photons and the NV center is changed to
Then a Hadamard operation H
1, which makes

, is operated on the component |
R′⟩. An attenuator A with transmission rate
κ is performed on the component |
L⟩ at the same time. The state of the system comprised of two photons and the NV center will be transformed to
Subsequently, the component
interacts with the NV center-cavity system. After the interaction, another Hadamard operation H2 and a bit-flip operation X, which makes |R⟩ ↔ |L⟩, are performed on photon 1. At this time, the state of the system comprised of two photons and the NV center is changed to
When photon 1 passes through CPBS
2, the component |
L′⟩ will be reflected to the output port with single-photon detector D, and the components |
R′⟩ and |
L⟩ will reunite and be transmitted to the output port with SW
2. The click of the detector D is an error alarm signal, and it denotes that the state of the system has collapsed in the wrong state

. If the detector D does not click, the state of the system comprised of two photons and the NV center will be
To balance the amplitudes of the components |
R′⟩ and |
L⟩, the transmission rate of A should be set as
κ = (
r −
r0)/2, and the state of the system comprised of two photons and the NV center is expressed as
If the detector D clicks, this parity-check process is failed without affecting the states of the NV center and photon 2, and another photon can be put into the quantum circuit to begin another parity-check process.
After photon 1 passes through the quantum circuit without triggering the detector D, photon 2 is imported into the quantum circuit using the optical switch SW1. After photon 2 passes through the quantum circuit shown in Fig. 2(a) without triggering the detector D, the state of the system comprised of two photons and the NV center can be expressed as
Then the state of the NV center is measured on the basis

. If the measurement result is

, the two photons are in even parity mode (i.e. |
R1⟩|
R2⟩ and |
L1⟩|
L2⟩). If the measurement result is

, the two photons are in odd parity mode (i.e. |
R1⟩|
L2⟩ and |
L1⟩|
R2⟩). Now, we have obtained the result of the HH-PCG, which is the essential component in the heralded EPP scheme for the photon system.
3.2. Heralded EPP scheme for two-photon systemThe photon systems are initially prepared in the maximally entangled Bell state
. Alice preserves the photon Ai and sends the photon Bi to Bob. After passing through the noisy communication channel, the photon Bi may suffer from bit-flip error and phase-flip error. The bit-flip error will cause a bit flip (|R⟩ ↔ |L⟩) on the photonic qubit, and the phase-flip error will cause a phase flip (|R⟩ → |R⟩, |L⟩ → − |L⟩) on the photonic qubit. If the photon Bi passes through the noisy communication channel with bit-flip error, the state of the photon system will be changed from the maximally entangled Bell state to the mixed state
where

.
F is the fidelity of the maximally entangled Bell state |
ϕ+⟩ in the mixed state. In two-photon Bell state, the phase-flip error can be transformed to bit-flip error by bilateral unitary operations.
In order to increase the fidelity of the maximally entangled Bell state |ϕ+⟩ in the mixed state, a heralded entanglement purification protocol is introduced. The quantum circuit of the heralded EPP scheme for the two-photon system with bit-flip error is shown in Fig. 2(b), where the two remote users, Alice and Bob, both operate HH-PCGs on their photon pairs. The NV centers of HH-PCGs are initially prepared in the state
. Two nonlocal entangled photon pairs A1B1 and A2B2 are required in the heralded EPP scheme, and they are initially in the state
That is, the four-photon system is in the state with four constituents: |
ϕ+⟩
A1B1|
ϕ+⟩
A2B2 with possibility
F2, |
ϕ+⟩
A1B1|
ψ+⟩
A2B2 with possibility
F (1 −
F), |
ψ+⟩
A1B1|
ϕ+⟩
A2B2 with possibility
F(1 −
F), and |
ψ+⟩
A1B1|
ψ+⟩
A2B2 with possibility (1 −
F)
2.
(1) For the first constituent, the four-photon system A1B1A2B2 is in the state |ϕ+⟩A1B1|ϕ+⟩A2B2 with possibility F2. The initial state of the system composed of the four-photon system and two NV centers of HH-PCGs is
After the two photons
A1B1 pass through the two HH-PCGs respectively (shown in Fig.
2(b)), the state of the system composed of the four-photon system and two NV centers is changed to
If the detectors D of HH-PCGs do not click, the state of the system composed of the four-photon system and two NV centers will be
Here
κ = (
r −
r0)/2. After the two photons
A2B2 pass through the two HH-PCGs, the state of the system composed of the four-photon system and two NV centers is changed to
if the detectors D of HH-PCGs do not click.
After the four photons pass through the two HH-PCGs, the two photons A2B2 will pass through PBSs, which can measure the polarization state of photon on the basis {|H⟩,|V⟩}. Here
and
. The state of the system composed of the four-photon system and two NV centers can be rewritten as
Alice and Bob measure the states of photon pair
A2B2 and two NV centers on the bases {|
H⟩,|
V⟩} and

, respectively. If the two NV centers are both in the state

(or

) and the two photons
A2B2 are in the state |
HA2⟩|
HB2⟩ (or |
VA2⟩|
VB2⟩), the two-photon system
A1B1 will be in the state |
ϕ+⟩
A1B1. If the two NV centers are both in the state

(or

) and the two photons
A2B2 are in the state |
HA2⟩|
VB2⟩ (or |
VA2⟩|
HB2⟩), the two-photon system
A1B1 will be in the state

, and a phase flip operation |
R⟩ → |
R⟩,|
L⟩ → − |
L⟩ is performed on photon
A1 (or
B1) to obtain the state |
ϕ+⟩
A1B1.
If the detectors D of HH-PCGs click, the state of the system composed of the four-photon system and two NV centers is in the wrong term, where two photons A1 (or A2) and B1 (or B2) are in the states
and
and detected by the detectors D. In this case, the states of the other photon pair and two NV centers are not affected, and another nonlocal photon pair A3B3 can be imported into quantum circuit in Fig. 2(b) to implement the heralded EPP scheme.
(2) For the second constituent, the four-photon system A1B1A2B2 is in the state |ϕ+⟩A1B1|ψ+⟩A2B2 with possibility F(1 − F). The initial state of the system composed of the four-photon system and two NV centers of HH-PCGs is
After two photon pairs pass through the HH-PCGs and PBSs, the state of the system composed of the four-photon system and two NV centers of HH-PCGs will be changed to
if the detectors D of HH-PCGs do not click.
For the third constituent, the four-photon system A1B1A2B2 is in the state |ψ+⟩A1B1|ϕ+⟩A2B2 with possibility F(1 − F). The initial state of the system composed of the four-photon system and two NV centers of HH-PCGs is
After two photon pairs pass through the HH-PCGs and PBSs, the state of the system composed of the four-photon system and two NV centers of HH-PCGs will be changed to
if the detectors D of HH-PCGs do not click.
Alice and Bob measure two NV centers with the basis
, and the measurement results show that the two NV centers are in different states (either
or
). In these two constituents, Alice and Bob cannot identify which photon pair has bit-flip error, so they have to discard the result of these two constituents. If the detectors D of HH-PCGs click, the state of the system composed of the four-photon system and two NV centers will be in the wrong term, and another nonlocal photon pair A3B3 can be imported into the quantum circuit in Fig. 2(b) to implement the heralded EPP scheme.
(3) For the fourth constituent, the four-photon system A1B1A2B2 is in the state |ψ+⟩A1B1|ψ+⟩A2B2 with possibility (1 − F)2. The initial state of the system composed of the four-photon system and two NV centers of HH-PCGs is
After two photon pairs pass through the HH-PCGs and PBSs, the state of the system composed of the four-photon system and two NV centers of HH-PCGs will be changed to
if the detectors D of HH-PCGs do not click.
Alice and Bob measure the states of photon pair A2B2 and two NV centers with bases {|H⟩,|V⟩} and
, respectively. If the two NV centers are both in the state
(or
) and the two photons A2B2 are in the state |HA2⟩|HB2⟩ (or |VA2⟩|VB2⟩), the two-photon system A1B1 is in the state |ψ+⟩A1B1. If the two NV centers are both in the state
(or
) and the two photons A2B2 are in the state |HA2⟩|VB2⟩ (or |VA2⟩|HB2⟩), the two-photon system A1B1 is in the state
, and a phase flip operation |R⟩ → |R⟩, |L⟩ → −|L⟩ is performed on photon A1 (or B1) to obtain the state |ψ+⟩A1B1. If the detectors D of HH-PCGs click, the state of the system composed of the four-photon system and two NV centers will be in the wrong term, and another nonlocal photon pair A3B3 can be imported into the quantum circuit in Fig. 2(b) to implement the heralded EPP scheme.
Finally, Alice and Bob can obtain a new mixed state
where

. When
F > 1/2, the fidelity of state |
ϕ+⟩
A1B1 is increased (
F′ >
F). By iterating the heralded EPP for several rounds, the parties will share a subset of two-photon systems with high (nearly unity) fidelity of state |
ϕ+⟩
AiBi. From Fig.
3(a), we can see that the fidelity of state |
ϕ+⟩
A1B1 in the mixed state will approach to 1 quickly in just 3 rounds of heralded EPP process.